Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim whitespaces from org names when an org is created or saved #1550

Merged

Conversation

AbdulWahab3181
Copy link
Contributor

Describe your changes

https://www.loom.com/share/149dc5a443dd463eb5dacc8c4f4bbf9f

Issue ticket number and link

Closes #1548

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have tested on a mobile device
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

@AbdulWahab3181 AbdulWahab3181 marked this pull request as ready for review February 22, 2024 11:39
Copy link
Contributor

@kevkevinpal kevkevinpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, I added a suggestion for another test but we can create another issue to make that test going to merge this PR now

Comment on lines +89 to +102
t.Run("should return error if org name contains only spaces", func(t *testing.T) {
rr := httptest.NewRecorder()
handler := http.HandlerFunc(oHandler.CreateOrEditOrganization)

invalidJson := []byte(`{"name": " "}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "/", bytes.NewReader(invalidJson))
if err != nil {
t.Fatal(err)
}

handler.ServeHTTP(rr, req)

assert.Equal(t, http.StatusBadRequest, rr.Code)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add another test to create a name that looks like " Abdul " and assert it gets added as "Abdul"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevkevinpal kevkevinpal merged commit af7d6c8 into stakwork:master Feb 22, 2024
1 check passed
@ecurrencyhodler
Copy link
Contributor

I added an extra 20k sats for the other test abdul. I'll pay out when I get funds.

@ecurrencyhodler
Copy link
Contributor

Paid 170k sats! https://community.sphinx.chat/bounty/1559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trim whitespaces from org names when an org is created or saved
3 participants